<!-- saved from url=(0014)about:internet -->
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

  <title>代付在线文档</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="public/static/css/layui.css">

  <link href="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/highlight.js/10.7.2/styles/monokai-sublime.min.css" type="text/css" rel="stylesheet" />
  <script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/highlight.js/10.7.2/highlight.min.js" type="application/javascript"></script>

</head>

<body layadmin-themealias="default">
  <div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
          <ul class="layui-tab-title">
            <li class="layui-this">签名规则</li>
            <li>代付api</li>
            <li>异步通知</li>
            <li>订单查询</li>
<!--            <li>订单驳回</li>-->
<!--            <li>余额查询</li>-->
<!--            <li>银行编码</li>-->

          </ul>
          <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
              <blockquote class="layui-elem-quote" style="word-break: break-all;">
                备注：<br>
                <blockquote class="layui-elem-quote layui-quote-nm">
                  <b style="color: red;">除sign其余参数都要参与签名</b> <a
                    href="http://sanfangtest.banxiaaliapiccfy.xyz/index/api/sign_test.html"
                    style="color: red;font-size: 1.3rem">代付验签在线接口测试</a>
                </blockquote>
                第一步：.根据代付api选项里面的参数，首字母大小写进行排序<br>
                <blockquote class="layui-elem-quote layui-quote-nm">
                  amount=100&amp;bank_code=ICBC&amp;bank_number=123123213&amp;
                  bank_owner=234324&amp;body=21&amp;mchid=100001&amp;notify_url=
                  123123&amp;out_trade_no=2005071832124472&amp;subject=c
                </blockquote>
                第二步：排序结束后，增加&amp;商户秘钥<br>
                <blockquote class="layui-elem-quote layui-quote-nm">
                  amount=100&amp;bank_code=ICBC&amp;bank_number=123123213&amp;
                  bank_owner=234324&amp;body=21&amp;mchid=100001&amp;notify_url=
                  123123&amp;out_trade_no=2005071832124472&amp;subject=c&amp;商户密钥
                </blockquote>
                第三步：md5加密<br>
                <blockquote class="layui-elem-quote layui-quote-nm">
                  进行md5,签名字符串全部转为小写
                </blockquote>
                PHP加密示例代码<br>
                <blockquote class="layui-elem-quote layui-quote-nm">
                  <style>
                    /* 格式化代码 */
                    pre code {
                      display: block;
                      padding-left: 2em;
                      text-indent: -2em;
                      text-align: left;
                    }

                    /* 添加复制按钮 */
                    .copy-btn {
                      background-color: #4CAF50;
                      border: none;
                      color: white;
                      padding: 8px 16px;
                      text-align: center;
                      text-decoration: none;
                      display: inline-block;
                      font-size: 14px;
                      margin: 4px 2px;
                      cursor: pointer;
                      border-radius: 4px;
                    }
                  </style>
                  <pre>                  <code class="php hljs language-php">
                    <span class="hljs-meta">&lt;?php</span>
                    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">generateSign</span>(<span class="hljs-params"><span class="hljs-variable">$data</span>, <span class="hljs-variable">$key</span></span>) </span>{
                      <span class="hljs-comment">// 按字母顺序排序参数</span>
                      ksort(<span class="hljs-variable">$data</span>);
                    
                      <span class="hljs-comment">// 拼接参数和商户秘钥</span>
                      <span class="hljs-variable">$signData</span> = <span class="hljs-string">''</span>;
                      <span class="hljs-keyword">foreach</span> (<span class="hljs-variable">$data</span> <span class="hljs-keyword">as</span> <span class="hljs-variable">$k</span> =&gt; <span class="hljs-variable">$value</span>) {
                        <span class="hljs-variable">$signData</span> .= <span class="hljs-variable">$k</span> . <span class="hljs-string">'='</span> . <span class="hljs-variable">$value</span> . <span class="hljs-string">'&amp;'</span>;
                      }
                      <span class="hljs-variable">$signData</span> .= <span class="hljs-variable">$key</span>;
                    
                      <span class="hljs-comment">// 使用MD5进行加密</span>
                      <span class="hljs-keyword">return</span> strtolower(md5(<span class="hljs-variable">$signData</span>));
                    }
            
                    <span class="hljs-variable">$data</span> = [
                    <span class="hljs-string">'amount'</span> =&gt; <span class="hljs-string">'100'</span>,
                    <span class="hljs-string">'bank_code'</span> =&gt; <span class="hljs-string">'ICBC'</span>,
                    <span class="hljs-string">'bank_number'</span> =&gt; <span class="hljs-string">'123123213'</span>,
                    <span class="hljs-string">'bank_owner'</span> =&gt; <span class="hljs-string">'234324'</span>,
                    <span class="hljs-string">'body'</span> =&gt; <span class="hljs-string">'21'</span>,
                    <span class="hljs-string">'mchid'</span> =&gt; <span class="hljs-string">'100001'</span>,
                    <span class="hljs-string">'notify_url'</span> =&gt; <span class="hljs-string">'http://127.0.0.1/notify.php'</span>,
                    <span class="hljs-string">'out_trade_no'</span> =&gt; <span class="hljs-string">'2005071832124472'</span>,
                    <span class="hljs-string">'subject'</span> =&gt; <span class="hljs-string">'c'</span>,
                  ];
                  <span class="hljs-variable">$key</span> = <span class="hljs-string">'商户密钥'</span>;
                  
                  <span class="hljs-variable">$sign</span> = generateSign(<span class="hljs-variable">$data</span>, <span class="hljs-variable">$key</span>);
             
                  <span class="hljs-meta">?&gt;</span>
                  </code>
                </pre>
                  <script>
                    hljs.initHighlightingOnLoad();
                  </script>

                </blockquote>

              </blockquote>
            </div>
            <div class="layui-tab-item">
              <blockquote class="layui-elem-quote">
                网关地址：http://www.***.com/payerApi/api/applyPaymentOrder
                <br><br>
                注意要点：POST <strong style="color: red;font-size: 1.3rem">form-data</strong> 方式请求
<!--                <a-->
<!--                  href="http://sanfangtest.banxiaaliapiccfy.xyz/index/api/test.html"-->
<!--                  style="color: red;font-size: 1.3rem">代付下单在线接口测试</a>-->
              </blockquote>
              <div class="layui-tab">
                <ul class="layui-tab-title">
                  <li class="layui-this">参数说明</li>
                  <li>返回示例</li>
                </ul>
                <div class="layui-tab-content">
                  <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                      <tbody>
                        <tr>
                          <td style="font-weight:bold">参数名</td>
                          <td style="font-weight:bold">必选</td>
                          <td style="font-weight:bold">类型</td>
                          <td style="font-weight:bold">说明</td>
                          <td style="font-weight:bold">参与签名</td>
                        </tr>
                        <tr>
                          <td>mer_id</td>
                          <td>是</td>
                          <td>string</td>
                          <td>商户id</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>mer_order_sn</td>
                          <td>是</td>
                          <td>string</td>
                          <td>商户订单 id 唯一 不能重复 重复会创建订单失败 由商户控制</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>amount</td>
                          <td>是</td>
                          <td>double</td>
                          <td>金额 最大两位小数</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>bank_name</td>
                          <td>是</td>
                          <td>string</td>
                          <td>接提交银行名称如：中国银行</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>notify_url</td>
                          <td>是</td>
                          <td>string</td>
                          <td>异步通知地址 必须http:或者https:格式</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>bank_number</td>
                          <td>是</td>
                          <td>string</td>
                          <td>银行账号/如传二维码这里传图片URL地址</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>bank_owner</td>
                          <td>是</td>
                          <td>string</td>
                          <td>开户姓名</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>sign</td>
                          <td>是</td>
                          <td>string</td>
                          <td>签名 见签名规则</td>
                          <td>是</td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                  <div class="layui-tab-item">
                    <pre class="layui-code">{
    "data": {
      "amount": "11.31",  //订单金额
      "order_sn": "df_api_202406041356035666", //平台订单号
      "mer_order_sn": "394d11h33dff5ddd43e1ddd", //商户订单号
      "service_fee": "0.11" //服务费
    },
    "code": 200,
    "message": "success"
}
                  </pre>
                  </div>
                </div>
              </div>
            </div>
            <div class="layui-tab-item">
              <blockquote class="layui-elem-quote">
                该通知以POST <strong style="color: red;font-size: 1.3rem">form-data</strong> 方式请求，编码：UTF8<br><br>
                SUCCESS 返回成功表示通知成功<br>
              </blockquote>

              <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>参数说明</legend>
              </fieldset>
              <div class="layui-tab">
                <ul class="layui-tab-title">
                  <li class="layui-this">参数说明</li>
                </ul>
                <div class="layui-tab-content">
                  <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                      <tbody>
                        <tr>
                          <td style="font-weight:bold">参数名</td>
                          <td style="font-weight:bold">必选</td>
                          <td style="font-weight:bold">类型</td>
                          <td style="font-weight:bold">说明</td>
                          <td style="font-weight:bold">参与签名</td>

                        </tr>
                        <tr>
                          <td>amount</td>
                          <td>string</td>
                          <td>是</td>
                          <td>金额</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>order_sn</td>
                          <td>string</td>
                          <td>是</td>
                          <td>平台订单号</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>mer_order_sn</td>
                          <td>string</td>
                          <td>是</td>
                          <td>商户订单号</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>sign</td>
                          <td>string</td>
                          <td>是</td>
                          <td>签名 见签名规则</td>
                          <td>否</td>
                        </tr>
<!--                        <tr>-->
<!--                          <td>code</td>-->
<!--                          <td>string</td>-->
<!--                          <td>是</td>-->
<!--                          <td>请求状态：1成功   2失败</td>-->
<!--                          <td>是</td>-->
<!--                        </tr>-->
                        <tr>
                          <td>error_reason</td>
                          <td>string</td>
                          <td>是</td>
                          <td>代付备注：代付成功时为空，代付失败时为失败原因，<span style="color: red">必须参与签名</span></td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>status</td>
                          <td>string</td>
                          <td>是</td>
                          <td>订单状态 status:3,5,6表示代付成功 status:4表示代付失败 其他值如1，2表示订单处理中</td>
                          <td>是</td>
                        </tr>

                        <tr>
                          <td>status_name</td>
                          <td>string</td>
                          <td>是</td>
                          <td>订单状态名称</td>
                          <td>是</td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
            <div class="layui-tab-item">
              <blockquote class="layui-elem-quote">
                网关地址：http://www.***.com/payerApi/api/paymentOrderInfo
                <br><br>
                注意要点：POST <strong style="color: red;font-size: 1.3rem">form-data</strong> 方式请求，编码：UTF8
              </blockquote>
              <div class="layui-tab">
                <ul class="layui-tab-title">
                  <li class="layui-this">参数说明</li>
                  <li>返回内容示例</li>
                </ul>
                <div class="layui-tab-content">
                  <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                      <tbody>
                        <tr>
                          <td style="font-weight:bold">参数名</td>
                          <td style="font-weight:bold">必选</td>
                          <td style="font-weight:bold">类型</td>
                          <td style="font-weight:bold">说明</td>
                          <td style="font-weight:bold">参与签名</td>
                        </tr>
                        <tr>
                          <td>mer_order_sn</td>
                          <td>是</td>
                          <td>string</td>
                          <td>商户订单号</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>mer_id</td>
                          <td>是</td>
                          <td>string</td>
                          <td>商户号</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>sign</td>
                          <td>是</td>
                          <td>string</td>
                          <td>签名 见签名规则</td>
                          <td>是</td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                  <div class="layui-tab-item">
                    <pre class="layui-code">
  {
	"data": [
		{
			"status": 2,  //订单状态：1等待支付  2处理中 3 5 6成功 4处理失败
			"mer_order_sn": "394d11h33dff5dd43e1",  //商户订单号
			"order_sn": "df_api_202405171833385771", //平台订单号
			"amount": "11.00",                  //订单金额
			"service_fee": "0.00",              //服务费
			"real_amount": "11.00",             //真实到账金额
			"operateImg": []                    //凭证图片列表
		}
	],
	"code": 200,
	"message": "success"
}


                    </pre>
                  </div>
                </div>
              </div>
            </div>
            <div class="layui-tab-item">
              <blockquote class="layui-elem-quote">
                网关地址：http://www.***.com/payerApi/api/cancelPaymentOrder
                <br><br>
                注意要点：POST <strong style="color: red;font-size: 1.3rem">form-data</strong> 方式请求，编码：UTF8
<!--                <a-->
<!--                  href="http://sanfangtest.banxiaaliapiccfy.xyz/index/api/reject_test.html"-->
<!--                  style="color: red;font-size: 1.3rem">代付驳回在线接口测试</a>-->
              </blockquote>
              <div class="layui-tab">
                <ul class="layui-tab-title">
                  <li class="layui-this">参数说明</li>
                  <li>返回内容示例</li>
                </ul>
                <div class="layui-tab-content">
                  <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                      <tbody>
                        <tr>
                          <td style="font-weight:bold">参数名</td>
                          <td style="font-weight:bold">必选</td>
                          <td style="font-weight:bold">类型</td>
                          <td style="font-weight:bold">说明</td>
                          <td style="font-weight:bold">参与签名</td>
                        </tr>
                        <tr>
                          <td>mer_order_sn</td>
                          <td>是</td>
                          <td>string</td>
                          <td>商户订单号</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>mer_id</td>
                          <td>是</td>
                          <td>string</td>
                          <td>商户号</td>
                          <td>是</td>
                        </tr>
                        <tr>
                          <td>sign</td>
                          <td>是</td>
                          <td>string</td>
                          <td>签名 见签名规则</td>
                          <td>否</td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                  <div class="layui-tab-item">
                    <pre class="layui-code">{
	"data": [],
	"code": 200,    //200成功 其他值都是失败
	"message": "success"
}

                    </pre>
                  </div>
                </div>

              </div>
              </div>
            </div>
            <div class="layui-tab-item">
              <blockquote class="layui-elem-quote">
                网关地址：http://www.***.com/payerApi/api/getBalance
                <br><br>
                注意要点：POST <strong style="color: red;font-size: 1.3rem">form-data</strong> 方式请求，编码：UTF8
              </blockquote>
              <div class="layui-tab">
                <ul class="layui-tab-title">
                  <li class="layui-this">参数说明</li>
                  <li>返回内容示例</li>
                </ul>
                <div class="layui-tab-content">
                  <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                      <colgroup>
                        <col width="160">
                        <col width="100">
                        <col width="120">
                        <col width="120">
                      </colgroup>
                      <tbody>
                        <tr>
                          <td style="font-weight:bold">参数</td>
                          <td style="font-weight:bold">类型</td>
                          <td style="font-weight:bold">是否必填</td>
                          <td style="font-weight:bold">描述</td>
                        </tr>
                        <tr>
                          <td>mer_id</td>
                          <td>string</td>
                          <td>是</td>
                          <td>商户id</td>
                        </tr>
                        <tr>
                          <td>sign</td>
                          <td>string</td>
                          <td>是</td>
                          <td>签名 见签名规则</td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                  <div class="layui-tab-item">
                    <pre class="layui-code">{
	"data": {
		"balance": "24.61"  //余额
	},
	"code": 200,
	"message": "success"
}
                    </pre>
                  </div>
                </div>
              </div>
            </div>
            <div class="layui-tab-item">
              <div class="layui-tab">
                <div class="layui-tab-content">
                  <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                      <colgroup>
                        <col width="160">
                        <col width="100">
                        <col width="120">
                        <col width="120">
                      </colgroup>
                      <tbody>
                        <tr>
                          <td style="font-weight:bold">银行名称</td>
                          <td style="font-weight:bold">编码</td>
                        </tr>
                        <tr>
                          <td>桂林银行</td>
                          <td>GLB</td>
                        </tr>
                        <tr>
                          <td>支付宝</td>
                          <td>ZFB</td>
                        </tr>
                        <tr>
                          <td>工商银行</td>
                          <td>ICBC</td>
                        </tr>
                        <tr>
                          <td>农业银行</td>
                          <td>ABC</td>
                        </tr>
                        <tr>
                          <td>中国民生银行</td>
                          <td>CMBC</td>
                        </tr>
                        <tr>
                          <td>中国建设银行</td>
                          <td>CCB</td>
                        </tr>
                        <tr>
                          <td>兴业银行</td>
                          <td>CIB</td>
                        </tr>
                        <tr>
                          <td>招商银行</td>
                          <td>CMB</td>
                        </tr>
                        <tr>
                          <td>中国光大银行</td>
                          <td>CEB</td>
                        </tr>
                        <tr>
                          <td>中国邮政储蓄银行</td>
                          <td>PSBC</td>
                        </tr>
                        <tr>
                          <td>中国银行</td>
                          <td>BOC</td>
                        </tr>
                        <tr>
                          <td>平安银行</td>
                          <td>PAB</td>
                        </tr>
                        <tr>
                          <td>中国农业银行</td>
                          <td>ABC</td>
                        </tr>
                        <tr>
                          <td>北京银行</td>
                          <td>BOB</td>
                        </tr>
                        <tr>
                          <td>上海浦东发展银行</td>
                          <td>SPDB</td>
                        </tr>
                        <tr>
                          <td>宁波银行</td>
                          <td>NBCB</td>
                        </tr>
                        <tr>
                          <td>中信银行</td>
                          <td>CITIC</td>
                        </tr>
                        <tr>
                          <td>华夏银行</td>
                          <td>HXB</td>
                        </tr>
                        <tr>
                          <td>交通银行</td>
                          <td>COMM</td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <script src="public/static/layui.js"></script>

  <script>
    layui.use('element', function () {
    });
  </script>


</body>

</html>
